<template>
  <div class="change_admin staffManage">
    <el-dialog
      title="日志变更记录"
      class="gl_dialog_TitleLine"
      :visible.sync="dialogVisible"
      :close-on-click-modal="false"
      width="980px"
    >
      <el-table
        :data="tableData"
        stripe
        style="width: 100%"
      >
        <el-table-column
          prop="commodityName"
          label="商品名称"
          width="120"
        />
        <el-table-column
          prop="clubName"
          label="分馆"
          width="120"
        />
        <el-table-column
          prop="changeTotal"
          label="变更数量"
          width="80"
        />
        <el-table-column
          prop="laveTotal"
          label="剩余数量"
          width="80"
        />
        <el-table-column
          prop="changeRemarks"
          label="变更备注"
        >
          <template slot-scope="scope">
            <el-link v-if="scope.row.changeTotal>0" type="success">{{ scope.row.changeRemarks }}</el-link>
            <el-link v-else type="primary">{{ scope.row.changeRemarks }}</el-link>
          </template>
        </el-table-column>
        <el-table-column
          prop="changeTime"
          label="变更时间"
        />
      </el-table>
    </el-dialog>
  </div>
</template>

<script>

export default {
  name: 'Account',
  data() {
    return {
      dialogVisible: false,
      tableData: [{
        commodityName: 'scb-数字位数',
        clubName: '元动未来',
        changeTotal: '+1',
        laveTotal: '5',
        changeRemarks: '线下现金支付-减少库存',
        changeTime: '2020-09-09 12:23:45'
      }, {
        commodityName: 'scb-数字位数',
        clubName: '元动未来',
        changeTotal: '-5',
        laveTotal: '9',
        changeRemarks: '总库存增加：元动未来俱乐部初始添加',
        changeTime: '2020-09-09 12:23:45'
      }]
    };
  },
  methods: {
    onSubmit() {
      console.log('submit!');
    },
    open() {
      this.dialogVisible = true;
    },
    close() {
      this.dialogVisible = false;
      this.$refs.form.resetFields();
    }
    // 点击确定添加
    // saveNew(formName) {
    //   this.$refs[formName].validate((valid) => {
    //     if (valid) {
    //       if (this.title === '新增') {
    //         const StudentCardData = this.formData;
    //         this.$emit('pushTabelData', JSON.parse(JSON.stringify(StudentCardData)));
    //         console.log(this.formData);
    //       } else {
    //         console.log(this.formData);
    //       }
    //     } else {
    //       return false;
    //     }
    //   });
    // }

  }
};
</script>

<style>

</style>
